<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../00.依赖包/react.development.js"></script>
  <script src="../00.依赖包/react-dom.development.js"></script>
  <script src="../00.依赖包/babel.min.js"></script>
</head>

<body>
  <div id="app"></div>
  <script type="text/babel">
    class Father extends React.Component{
      state= {
        car:'十年的雅阁'
      }
      render(){
        const {car} = this.state
        return(
          <div>
          <p>我是老子</p>  
          <p>我开的车是{car}</p> 
          <Son car={car}/>
          </div>
        )
      }
    }
    
    function Son(props){
      
      console.log('son',props);
      const{car} = props
      return(
        <p>我是儿子，开我爸爸的{car}</p>
      )
    }

    const root = ReactDOM.createRoot(document.getElementById('app'));
    root.render(< Father/>)
  </script>
</body>

</html>